package com.library.mapper;

import com.library.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface BookMapper {
    List<Book> findAll();
    
    Book findById(@Param("id") Long id);
    
    Book findByIsbn(@Param("isbn") String isbn);
    
    List<Book> searchBooks(@Param("keyword") String keyword);
    
    int insert(Book book);
    
    int update(Book book);
    
    int deleteById(@Param("id") Long id);
    
    int updateStock(@Param("id") Long id, @Param("delta") int delta);
}
